package com.mall.db.jpa.domain;


import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.experimental.Accessors;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;
import java.math.BigDecimal;
import java.util.Date;

@EntityListeners(AuditingEntityListener.class)
@Entity
@Table(name = "goods")
@Data
@Accessors(chain = true)
@Schema(description = "商品表")
public class Goods {

    @Id
    @GeneratedValue(strategy = GenerationType.TABLE, generator = "roleSeq")
    @TableGenerator(name = "roleSeq", allocationSize = 1, table = "seq_table", pkColumnName = "seq_id", valueColumnName = "seq_count")
    @Schema(description = "商品编号")
    private Long gdId;

    @Column
    @Schema(description = "商品名称")
    private String gdName;

    @Column
    @Schema(description = "商品价格")
    private BigDecimal gdPrice;

    @Column
    @CreatedDate
    @Schema(description = "创建时间")
    private Date createDate;


}
